package com.xnfh.field.viewmodel

import com.xnfh.common.bean.CropBean
import com.xnfh.framework.bean.RespStateData
import com.xnfh.network.base.BaseRepository
import com.xnfh.network.manager.ApiManager
import okhttp3.RequestBody

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2023/11/30 13:42
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/11/30 13:42
 * @UpdateRemark: 更新说明
 */
class FieldEditorViewModelRes : BaseRepository() {
    suspend fun requestCropList(requestBody: RequestBody, cropList: RespStateData<List<CropBean>>) =
        dealResp(
            { ApiManager.api.requestCropList(requestBody) }, cropList
        )

    suspend fun requestRemoveFieldById(requestBody: RequestBody, removeField: RespStateData<Any>) =
        dealResp(
            { ApiManager.api.requestRemoveField(requestBody) }, removeField
        )

    suspend fun requestEditField(requestBody: RequestBody, editField: RespStateData<Any>) =
        dealResp(
            { ApiManager.api.requestEditField(requestBody) }, editField
        )

    suspend fun requestLzField(requestBody: RequestBody, editField: RespStateData<Any>) =
        dealResp(
            {ApiManager.api.requestLzField(requestBody)},editField
        )
}